import React, {PureComponent} from 'react'
import {View, SectionList, Text, Image,UIManager,findNodeHandle, Dimensions,TouchableOpacity, StyleSheet,SafeAreaView, Animated,DeviceEventEmitter} from 'react-native'
import {NavigationActions} from "react-navigation";


const {width} = Dimensions.get('window')

type Props = {
    navigation:any,
}
export default class BuySuccessScene extends PureComponent<Props>{
    static navigationOptions = ({navigation}) => ({
        headerTintColor:'#333333',
        headerStyle:{backgroundColor:'white'},
        title:'购买成功',
        headerRight:<Text/>,
        headerLeft:<TouchableOpacity onPress={()=>{
            navigation.goBack()
        }}>
            <Image style={{marginLeft:12}} source={require('../../../res/img/gobal_back.png')}/>
        </TouchableOpacity>
    });

    render(){
        return <SafeAreaView style={{backgroundColor:'#F5F5F5',flex: 1,
            justifyContent:"center",
            alignItems:'center'}}>
            <View style={{justifyContent:'center',alignItems:'center',marginTop:70}}>
                <Image style={{width:124,height:185}} source={require('../../../res/img/detail/detail_buy.png')}/>
                <View style={{width:width-20,height:1,backgroundColor:'rgba(0,0,0,0.1)', marginTop:36,marginBottom:20}}/>
                <View style={{flex:1,flexDirection:'row'}}>
                    {/*<TouchableOpacity onPress={()=>{*/}

                    {/*}} style={{justifyContent:'center', alignItems:'center',width:(width-20)/2,height:30}}>*/}
                        {/*<Text style={{color:'#999999',fontSize:16,fontWeight:'bold'}}>查看课程</Text>*/}
                    {/*</TouchableOpacity>*/}
                    {/*<View style={{width:1,height:17,marginTop:5,backgroundColor:'rgba(0,0,0,0.1)'}}/>*/}
                    <TouchableOpacity onPress={()=>{
//重置根视图，闪屏页=>主界面后销毁掉
                        const resetAction = NavigationActions.reset({
                            index: 0,
                            actions: [NavigationActions.navigate({routeName: 'home'})]
                        })
                        this.props.navigation.dispatch(resetAction)
                    }} style={{justifyContent:'center', alignItems:'center',width:(width-20),height:30}}>
                        <Text style={{color:'#555555',fontSize:16,fontWeight:'bold'}}>继续购课</Text>
                    </TouchableOpacity>
                </View>
            </View>
        </SafeAreaView>
    }
}